package com.econ.powercloud.ems.common.enums;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2023-02-16-8:53
 */
public enum TimeSectionType implements EnumMethod{
    TIP(1,"尖"),
    PEAK(2,"峰"),
    FLAT(3,"平"),
    VALLEY(4,"谷"),
    ;
    private Integer code;
    private String desc;

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    TimeSectionType(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

    public static String getDescFromCode(Integer code){
        for (TimeSectionType type :TimeSectionType.values()){
            if (type.code.equals(code)){
                return type.desc;
            }
        }
        return null;
    }
}
